﻿using PetaPoco;
using System;
using System.ComponentModel.DataAnnotations;

namespace Cxuu.Models;

[TableName("cxuu_article_docreceived")]
[PrimaryKey("Id", AutoIncrement = true)]
public class ArticleDocreceived
{
    /// <summary>
    /// ID
    /// </summary>
    public int Id { get; set; }
    /// <summary>
    /// 类别
    /// </summary>
    public int Cid { get; set; }
    /// <summary>
    /// 标题
    /// </summary>
    public string Title { get; set; }
    /// <summary>
    /// 附件
    /// </summary>
    public string Attments { get; set; }
    /// <summary>
    /// 用户ID
    /// </summary>
    public int Uid { get; set; }

    /// <summary>
    /// 状态标识
    /// </summary>
    public int Miji { get; set; } = 0;
    /// <summary>
    /// 信息报送时间
    /// </summary>
    public DateTime GreatTime { get; set; }
    /// <summary>
    /// 写入系统时间
    /// </summary>
    public DateTime InsertTime { get; set; } = DateTime.Now;
    /// <summary>
    /// 文号
    /// </summary>
    public string DocNumber { get; set; }

    /// <summary>
    /// 来文部门
    /// </summary>
    public string Department { get; set; }

    /// <summary>
    /// 备注
    /// </summary>
    public string Remarks { get; set; }
    /// <summary>
    /// 经办人
    /// </summary>
    public string Clercator { get; set; }
}

public class ViewArticleDocreceivedAndCate
{
    public int Id { get; set; }
    public int Cid { get; set; }
    public string Title { get; set; }
    public string CateName { get; set; }
    public string DeptName { get; set; }
    public string Nickname { get; set; }
    /// <summary>
    /// 状态标识
    /// </summary>
    public int Miji { get; set; }
    /// <summary>
    /// 信息报送时间
    /// </summary>
    public DateTime GreatTime { get; set; }
    /// <summary>
    /// 写入系统时间
    /// </summary>
    public DateTime InsertTime { get; set; }
    /// <summary>
    /// 文号
    /// </summary>
    public string DocNumber { get; set; }
    /// <summary>
    /// 报送部门
    /// </summary>
    public string Department { get; set; }
    /// <summary>
    /// 经办人
    /// </summary>
    public string Clercator { get; set; }
    /// <summary>
    /// 备注
    /// </summary>
    public string Remarks { get; set; }

}


public class EditArticleDocreceived
{
    public int Id { get; set; }
    [Display(Name = "类别")]
    [Required(ErrorMessage = "请选择类别")]
    public int Cid { get; set; }
    [Display(Name = "文件标题")]
    [Required(ErrorMessage = "文件标题未填写")]
    public string Title { get; set; }
    public string Attments { get; set; }

    [Display(Name = "来文时间")]
    [Required(ErrorMessage = "来文时间未填写")]
    public DateTime GreatTime { get; set; }
    public DateTime InsertTime { get; set; } = DateTime.Now;
    [Display(Name = "密级")]
    public int Miji { get; set; }

    [Display(Name = "文号")]
    public string DocNumber { get; set; }
    [Display(Name = "来文部门")]
    public string Department { get; set; }
    /// <summary>
    /// 经办人
    /// </summary>
    [Display(Name = "经办人")]
    public string Clercator { get; set; }

    [Display(Name = "备注")]
    public string Remarks { get; set; }
    public string CateName { get; set; }
    public string Groupname { get; set; }
}


/// <summary>
/// 查询模型
/// </summary>
public class ArticleDocreceivedQuery : Page<ViewArticleDocreceivedAndCate>
{
    public string Cid { get; set; }
    public string SearchCid { get; set; }
    public int Limit { get; set; } = 15;
    public string Orderby { get; set; }
    public int Miji { get; set; } = -1;
    public int Uid { get; set; }
    public string Title { get; set; }
    /// <summary>
    /// 经办人
    /// </summary>
    public string Clercator { get; set; }
    /// <summary>
    /// 文号
    /// </summary>
    public string DocNumber { get; set; }
    public string Uids { get; set; }
}


